<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
    function draw() {
      var canvas = document.getElementById('canvas')
      if (canvas.getContext) {
        var ctx = canvas.getContext('2d')
        for (var i=0; i<6; i++) {
          for (var j=0; j<6; j++) {
            ctx.fillStyle = `rgb(${255 - 42.5 * i}, ${255 - 42.5 * j}, 0)`
            ctx.fillRect(15+15*j, 15+15*i, 20, 20)
          }
        }
      }
    }
  </script>
</head>
<body onload="draw()">
  <canvas id="canvas" width="150" height="150"></canvas>
</body>
</html>